<%@ page contentType="text/html; charset=UTF-8"%>
<% response.setHeader("Cache.Control","no-cache"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0);%>

<jsp:useBean id="action" scope="request"
	class="swd.maintain.project.user_group_maintain.Action" />
<jsp:useBean id="view" scope="request"
	class="swd.maintain.project.user_group_maintain.View" />
<jsp:setProperty name="view" property="*" />
<%if (action.action(pageContext).equals("login")){return;} %>
<jsp:useBean id="DataView" scope="request"
	type="com.pub.database.DataView" />
<!-- 以下為DataView 共用設定 -->
<jsp:useBean id="DataViewForm" scope="request"
	type="com.pub.database.DataViewForm" />
<jsp:setProperty name="DataViewForm" property="submitMethod"
	value="POST" />
<jsp:setProperty name="DataViewForm" property="pageRowCount" value="0" />
<jsp:setProperty name="DataViewForm" property="nowPageNum" />
<jsp:setProperty name="DataViewForm" property="dataViewAction" />
<jsp:setProperty name="DataViewForm" property="filterCol" />
<jsp:setProperty name="DataViewForm" property="filterValue" />
<jsp:setProperty name="DataViewForm" property="dvOrderByFields" />
<jsp:setProperty name="DataViewForm" property="dvOrderBySeq" />
<!-- DataView 設定結束 -->

<html>
<head>
<title><%=view.getPrgTitle()%></title>
<LINK HREF="/SWD/workflow.css" REL="STYLESHEET" TYPE="TEXT/CSS">
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commscript.js"></script>
<script type="text/javascript" language="javascript1.2"
	src="/PUBPAGE/general/commhtmlscript.js"></script>
<SCRIPT LANGUAGE="javascript1.2" SRC="/SWD/general/swd.js"
	TYPE="TEXT/javascript"></SCRIPT>
</head>
<script language="javascript" type="text/javascript">
    function saveRowSn(rowsn){
       if(document.all.item('rowsn').value.indexOf(rowsn)>-1){
          return;//已記錄過就不再記錄了
       }
       if(document.all.item('rowsn').value==''){
         document.all.item('rowsn').value=rowsn;
       } else{
         document.all.item('rowsn').value=document.all.item('rowsn').value + ',' + rowsn;
       }
    }

    function fc_save_before_check(){
         // 工號
         if (document.all.item('user_no').value==""){
            alert("工號沒有值!!");
            return;
         }

         document.all.item('prgAction').value='save';
         document.forms[0].submit();
    }

      function fc_ins_before_check(){

         if (document.all.item('group_no').value==""){
            alert("請輸入群組編號");
            return;
         }

       document.all.item('prgAction').value='add';
       document.forms[0].submit();

    }
</script>
<body bgcolor="#ffffff" onload="<%=view.getOnloadScript()%>">
<TABLE BORDER="0" HEIGHT="20" CELLPADDING="0" CELLSPACING="0">
	<TR>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="LEFT"><IMG SRC="/SWD/pub_images/title01.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /><IMG
			SRC="/SWD/pub_images/glass.gif" WIDTH="12" HEIGHT="8" alt="" /></DIV>
		</TD>
		<TD ALIGN="LEFT" HEIGHT="20" VALIGN="MIDDLE"
			BACKGROUND="/SWD/pub_images/title_bg.gif" CLASS="TITLE"><%=view.getPrgTitle()%></TD>
		<TD BACKGROUND="/SWD/pub_images/title_bg.gif">
		<DIV ALIGN="RIGHT"><IMG SRC="/SWD/pub_images/glass.gif"
			WIDTH="12" HEIGHT="8" alt="" /><IMG SRC="/SWD/pub_images/title02.gif"
			WIDTH="18" HEIGHT="24" HSPACE="0" alt="" /></DIV>
		</TD>
	</TR>
</TABLE>
<br />
<form action="<%=request.getRequestURI() %>" method="POST">

<TABLE BORDER="0" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnAddTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_ins_before_check();" /></TD>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnSaveTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:fc_save_before_check();" /></TD>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnQueryTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='query';document.forms[0].submit();" /></TD>
		<TD style="" width="5%" CLASS="td_content"><INPUT TYPE="BUTTON"
			VALUE="<%=view.getBtnExitTitle()%>" CLASS="button b_normal"
			ONCLICK="javascript:document.all.item('prgAction').value='exit';document.forms[0].submit();" /></TD>
		<TD width="90%" CLASS="td_content">&nbsp;</TD>
	</TR>
	<TR>
		<TD colspan=5><font color="red"><%=(view.getTipMessage()!=null ? "工作提示:"+ view.getTipMessage() : "")%></font>
		</TD>
	</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0">
	<TR>
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getgroup_no_readonly() ? "" : "<img src=\"/SWD/pub_images/star.gif\">"%><%=view.getgroup_noTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="group_no" SIZE="8" MAXLENGTH="8"
			VALUE="<%=(view.getgroup_no()!=null ? view.getgroup_no() : "")%>"
			<%=view.getgroup_no_readonly() ? "readonly" : "onDblClick=\"javascript:fc_get_group_data(this);\""%>
			CLASS="<%=(view.getgroup_no_readonly() ? "input_noborder" : "input_window hand")%>" />
		</TD>
	</TR>
	<TR style="">
		<TD nowrap WIDTH="20%" CLASS="td_head"><%=view.getuser_no_readonly()? "" : "<img src=\"/SWD/pub_images/star.gif\">"%><%=view.getuser_noTitle()%></TD>
		<TD WIDTH="80%" CLASS="td_content"><INPUT TYPE="TEXT"
			NAME="user_no" SIZE="8" MAXLENGTH="8"
			VALUE="<%=(view.getuser_no()!=null ? view.getuser_no() : "")%>"
			<%=view.getuser_no_readonly() ? "readonly" : ""%>
			CLASS="<%=(view.getuser_no_readonly() ? "input_noborder" : "input_window hand")%>"
			onDblClick="javascript:fc_find_employee('<%=view.getDBAlias()%>',this,document.all.item('username'),null,null);"
			onfocus="if(this.value==''){this.value='';}"
			onchange="javascript:fc_get_employee_data('<%=view.getDBAlias()%>',this,document.all.item('username'),null,null);" />
		<INPUT TYPE="TEXT" NAME="username" SIZE="20" MAXLENGTH="10"
			VALUE="<%=(view.getusername()!=null ? view.getusername() : "")%>"
			readonly CLASS="input_noborder" /></TD>
	</TR>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="prgAction" VALUE="<%=view.getPrgAction()%>" />
<INPUT TYPE="HIDDEN" NAME="prgStatus" VALUE="<%=view.getPrgStatus()%>" />
<INPUT TYPE="HIDDEN" NAME="flowAction" VALUE="<%=view.getFlowAction()%>" />
<INPUT TYPE="HIDDEN" NAME="flowStatus" VALUE="<%=view.getFlowStatus()%>" />

<TABLE BORDER="0" WIDTH="540px" CELLSPACING="1" CELLPADDING="0" style="">
	<tr>
		<td>
		<%
      DataView.OutputDataView(DataViewForm, pageContext);

 %>
		</td>
	</tr>
</TABLE>

</form>
</body>
</html>
